import request from '@/utils/request'

// 查询项目立项列表
export function listInit(query) {
  return request({
    url: '/mis/init/list',
    method: 'get',
    params: query
  })
}

// 通过id修改项目信息
export function updateProjectTypeById(data) {
  return request({
    url: '/mis/init/updateProjectTypeById',
    method: 'post',
    data: data
  })
}
// 根据隶属销售查询项目立项列表
export function queryPorjectByAffiliateSale(query) {
  return request({
    url: '/mis/init/queryPorjectByAffiliateSale',
    method: 'get',
    params: query
  })
}
// 查询项目名称和ID
export function listInitNameAndId(query) {
  return request({
    url: '/mis/init/listInitNameAndId',
    method: 'post',
    timeout: 60000,
    params: query
  })
}
// 查询销售线索或项目立项列表
export function clueOrPro(query) {
  return request({
    url: '/mis/init/clueOrPro',
    method: 'get',
    params: query
  })
}

// 查询项目立项详细
export function getInit(id) {
  return request({
    url: '/mis/init/' + id,
    method: 'get'
  })
}

// 新增项目立项
export function addInit(data) {
  return request({
    url: '/mis/init',
    method: 'post',
    data: data
  })
}

// 修改项目立项
export function updateInit(data) {
  return request({
    url: '/mis/init',
    method: 'put',
    data: data
  })
}

// 删除项目立项
export function delInit(ids) {
  return request({
    url: '/mis/init/' + ids,
    method: 'delete'
  })
}
// 标杆项目立项
export function poleInit(ids) {
  return request({
    url: '/mis/init/poleInit/' + ids,
    method: 'get'
  })
}

// 新增销售线索
export function addLead(data) {
  return request({
    url: '/mis/init/addLead',
    method: 'post',
    data: data
  })
}
// 新增销售线索和附件信息
export function addLeadAndFile(data) {
  return request({
    url: '/mis/init/addLeadAndFile',
    method: 'post',
    data: data
  })
}

// 修改销售线索
export function updateLead(data) {
  return request({
    url: '/mis/init/updateLead',
    method: 'put',
    data: data
  })
}

// 查询销售线索
export function leadList(query) {
  return request({
    url: '/mis/init/getLeadList',
    method: 'get',
    params: query
  })
}

// 修改销售线索
export function editLead(data) {
  return request({
    url: '/mis/init/editLead',
    method: 'put',
    data: data
  })
}
// 修改销售线索和通知
export function editLeadAndNotice(data) {
  return request({
    url: '/mis/init/editLeadAndNotice',
    method: 'post',
    data: data
  })
}
// 新增销售线索和通知
export function addLeadAndNotice(data) {
  return request({
    url: '/mis/init/addLeadAndNotice',
    method: 'post',
    data: data
  })
}
